﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using NetworkSupervisor.Helper;

namespace NetworkSupervisor
{
    public partial class FormSingleQQOnLineCheck : DevExpress.XtraEditors.XtraForm
    {
        public FormSingleQQOnLineCheck()
        {
            InitializeComponent();
        }

        private void txtQqCode_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsNumber(e.KeyChar)) e.Handled = true;
        }

        private void btnOnLineCheck_Click(object sender, EventArgs e)
        {
            string qq = txtQqCode.Text;
            if (qq == "") return;
            bool onLine = QQHelper.CheckQQOnLine(qq);
            txtOnLineStatus.Text = onLine ? "在线" : "不在线";
        }

        private void btnContactMe_Click(object sender, EventArgs e)
        {
            string qq = txtQqCode.Text;
            if (qq == "") return;
            System.Diagnostics.Process.Start(QQHelper.GetQQOnlineChatUrl(qq));
        }

        private void btnOpenZone_DoubleClick(object sender, EventArgs e)
        {
        }

        private void btnOpenZone_Click(object sender, EventArgs e)
        {
            string qq = txtQqCode.Text;
            if (qq == "") return;
            System.Diagnostics.Process.Start(QQHelper.GetQQZoneUrl(qq));
        }
    }
}